#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "cv_setting.h"
#include "it_setting.h"
#include <QMainWindow>
#include <QMessageBox>
#include <QTimer>
#include <QChart>
#include "QChartView"
#include <QSplineSeries>
#include <QValueAxis>
#include "qserialport.h"
#include "qserialportinfo.h"

QT_CHARTS_USE_NAMESPACE

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    //void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;

private slots:
    void on_Operation_Button_clicked();

    void Read_Data();
    void update();
    void runupdate();

    void CV_Receiver();
    void IT_Receiver();

    void on_SelectCV_Button_clicked();

    void on_SelectIT_Button_clicked();

    void on_StartMeaButton_clicked();

    void on_RemoveButton_clicked();

    void on_Save_Button_clicked();

    void on_SendPar_Button_clicked();

private:
    Ui::MainWindow *ui;
    IT_Setting *ITdialog;
    CV_Setting *CVdialog;
    QTimer *timer;
    //QTimer *time_run;
    int Runtime;
    QSerialPort *serial;
    QLineSeries * line1;
    QChart* QCline;
    double Xvalue;                              //设置X轴变量
    double Yvalue;                              //设置Y轴变量
    double Receive_Buff[200]={};
    int Receive_Head;
    int Receive_End;
    QValueAxis *axisX;                          //建立坐标轴
    QValueAxis *axisY;

};
#endif // MAINWINDOW_H
